use serde::{Deserialize, Serialize};

#[derive(Debug, Serialize, Deserialize, Clone)]
#[serde(rename_all = "camelCase")]
pub struct GatewayConfig {
    pub listen: u32,
    pub tls: bool,
    pub cert_file: String,
    pub key_file: String,
}

impl GatewayConfig {
    pub fn new(port: u32) -> Self {
        let mut res = Self::default();
        res.listen = port;
        res
    }
}

impl Default for GatewayConfig {
    fn default() -> Self {
        Self {
            listen: 0,
            tls: false,
            cert_file: "".to_string(),
            key_file: "".to_string(),
        }
    }
}
